package com.sunday.member.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class Address extends Base implements Parcelable {
	public long memberId;
	public String name;
	public String mobile;
	public String address;
	public int provinceId;
	public int cityId;
	public int districtId;
	public String province;
	public String city;
	public String district;
	public boolean isMain;         //是否为默认收货地址


	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(this.memberId);
		dest.writeString(this.name);
		dest.writeString(this.mobile);
		dest.writeString(this.address);
		dest.writeInt(this.provinceId);
		dest.writeInt(this.cityId);
		dest.writeInt(this.districtId);
		dest.writeString(this.province);
		dest.writeString(this.city);
		dest.writeString(this.district);
		dest.writeByte(this.isMain ? (byte) 1 : (byte) 0);
	}

	public Address() {
	}

	protected Address(Parcel in) {
		this.memberId = in.readLong();
		this.name = in.readString();
		this.mobile = in.readString();
		this.address = in.readString();
		this.provinceId = in.readInt();
		this.cityId = in.readInt();
		this.districtId = in.readInt();
		this.province = in.readString();
		this.city = in.readString();
		this.district = in.readString();
		this.isMain = in.readByte() != 0;
	}

	public static final Parcelable.Creator<Address> CREATOR = new Parcelable.Creator<Address>() {
		@Override
		public Address createFromParcel(Parcel source) {
			return new Address(source);
		}

		@Override
		public Address[] newArray(int size) {
			return new Address[size];
		}
	};
}
